<style type="text/css">
	.image-result-content {
		max-height: 50px;
		overflow: hidden;
		margin-bottom: 5px;
	}
	#image-result,#logo-result {
		max-height: 50px;
	}
</style>
<form action="" class="form-horizontal" role="form">

	<div class="form-group">
		<label class="col-sm-2 control-label">请选择栏目</label>
		<div class="col-sm-4">
		<select  name="article_category_id">
		{$adContent.articleCategoryOptions}
		
		</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">标题</label>
		<div class="col-sm-4">
			<input type="text" class="form-control" name="title" placeholder="请输入标题"  value="{$adContent.title}"/>
		</div>
	</div>

	<div class="form-group">
	    <label class="col-sm-2 control-label">广告图片</label>
	    <div class="col-sm-4">
	    	<div class="image-result-content">
	    		<img id="logo-result" class="margin-bottom" src="{$adContent.pic}" />
	    	</div>
	        <input type="text" id="pic" name="pic" class="form-control margin-bottom" value="{$adContent.pic}"/>
			<input type="file" name="logo_upload" id="logo_upload" />
	    </div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">连接地址</label>
		<div class="col-sm-4">
			<input type="text" class="form-control" name="url" placeholder="请输入连接地址"  value="{$adContent.url}"/>
		</div>
	</div>
     <div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
			<input type="hidden" name="id" value="{$adContent.id}"/>
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/save">保存更改</button>
		</div>
	</div>

	
</form>


<!-- uploadify -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/uploadify/uploadify.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/uploadify/jquery.uploadify.min.js?{:rand(0,9999)}"></script>
<script type="text/javascript">
$(function() {
    $("#logo_upload").uploadify({
        'multi'			:	false,
        'fileSizeLimit' : 	'200kb',
        'buttonText'	:	'选择图片',
        'fileTypeDesc' 	: 	'Image Files',
        'fileTypeExts' 	: 	'*.jpg; *.png',
        'swf'			: 	'__PUBLIC__/Style/Common/uploadify/uploadify.swf',
        'uploader'		: 	'__MODULE__/Upload/uploadOne',
        'onUploadSuccess'	: function(data, res){
        	
        	var url = eval("(" + res + ")").extra.url;
        	$("#logo-result").attr("src", url);
        	$("#pic").val( url );
        	
        }
    });

});
</script>
